package day06.Ti.ZDYYC;

import java.util.Scanner;

public class TiYc {
    public static void main(String[] args) {
        Student s=new Student();
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入姓名");
        String name = sc.next();
        s.setName(name);
        try {
            System.out.println("请输入性别");
            String xb = sc.next();
            s.setXb(xb);
        } catch (SexException e) {

        }
        try {
            System.out.println("请输入年龄");
            int age = sc.nextInt();
            s.setAge(age);
        } catch (Exception e) {
            System.out.println("年龄错误");
        }
        System.out.println("姓名为"+s.getName()+"性别为"
                +s.getXb()+"年龄为"+s.getAge());
    }
}
